package org.order;

import org.apache.dubbo.config.annotation.Reference;
import org.pojo.po.TradeOrder;
import org.service.OrderService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hu-zhi-jun
 * @date: 2021-06-07
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Reference
    private OrderService orderService;

    @RequestMapping("getOrder")
    public TradeOrder getOrder(@RequestParam("orderId") Integer orderId){
        return orderService.getOrderById(orderId);
    }

    @RequestMapping("confirmOrder")
    public void confirmOrder( ){
       orderService.confirmOrder();
    }


}
